/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cpasl;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.GridPane;

/**
 *
 * @author seanm_000
 */
public class BigDGridPane extends GridPane {
    
    public BigDGridPane() {
        setAlignment(Pos.CENTER);
        setHgap(15);
        setVgap(15);
        
        Label genderLabel = new Label("Do you identify culturally with the ‘big-D’ Deaf community?");
        final ToggleGroup genderGroup = new ToggleGroup();
        RadioButton yesButton = new RadioButton("Yes");
        yesButton.setUserData("A");
        yesButton.setToggleGroup(genderGroup);
        yesButton.setSelected(true);
        RadioButton noButton = new RadioButton("No");
        noButton.setUserData("B");
        noButton.setToggleGroup(genderGroup);
        
        Button nextButton = new Button();
        nextButton.setText("Next");
        nextButton.setId("next-button");
        nextButton.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent event) {
                String userData = (String) ((RadioButton) genderGroup.getSelectedToggle()).getUserData();
                CpaslManager.getInstance().setIdentifyWithBigD(userData.equals("A"));
                CpaslManager.getInstance().switchToDisplay(Groups.NATIVE, 0);
            }
        });
        
        add(genderLabel, 0, 0);
        add(yesButton, 0, 1);
        add(noButton, 0, 2);
        add(nextButton, 0, 3);
    }
    
}
